package com.ruoyi.pyo.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.pyo.mapper.PetYeahGoodsMapper;
import com.ruoyi.pyo.domain.PetYeahGoods;
import com.ruoyi.pyo.service.IPetYeahGoodsService;

/**
 * 商品Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-11-19
 */
@Service
public class PetYeahGoodsServiceImpl implements IPetYeahGoodsService 
{
    @Autowired
    private PetYeahGoodsMapper petYeahGoodsMapper;

    /**
     * 查询商品
     * 
     * @param id 商品主键
     * @return 商品
     */
    @Override
    public PetYeahGoods selectPetYeahGoodsById(Long id)
    {
        return petYeahGoodsMapper.selectPetYeahGoodsById(id);
    }

    /**
     * 查询商品列表
     * 
     * @param petYeahGoods 商品
     * @return 商品
     */
    @Override
    public List<PetYeahGoods> selectPetYeahGoodsList(PetYeahGoods petYeahGoods)
    {
        return petYeahGoodsMapper.selectPetYeahGoodsList(petYeahGoods);
    }

    /**
     * 新增商品
     * 
     * @param petYeahGoods 商品
     * @return 结果
     */
    @Override
    public int insertPetYeahGoods(PetYeahGoods petYeahGoods)
    {
        petYeahGoods.setCreateTime(DateUtils.getNowDate());
        return petYeahGoodsMapper.insertPetYeahGoods(petYeahGoods);
    }

    /**
     * 修改商品
     * 
     * @param petYeahGoods 商品
     * @return 结果
     */
    @Override
    public int updatePetYeahGoods(PetYeahGoods petYeahGoods)
    {
        petYeahGoods.setUpdateTime(DateUtils.getNowDate());
        return petYeahGoodsMapper.updatePetYeahGoods(petYeahGoods);
    }

    /**
     * 批量删除商品
     * 
     * @param ids 需要删除的商品主键
     * @return 结果
     */
    @Override
    public int deletePetYeahGoodsByIds(Long[] ids)
    {
        return petYeahGoodsMapper.deletePetYeahGoodsByIds(ids);
    }

    /**
     * 删除商品信息
     * 
     * @param id 商品主键
     * @return 结果
     */
    @Override
    public int deletePetYeahGoodsById(Long id)
    {
        return petYeahGoodsMapper.deletePetYeahGoodsById(id);
    }
}
